<?php if (isset($training)):
	$surveys = $training->traininggroup()->survey();
	if($surveys) $survey = $surveys[0];

?>
<fieldset>
    <legend>Terminübersicht</legend>
    <?php if (!is_null($training->appointment_to)): ?>
    <table class="table table-striped table-condensed" style="width:90%;">
        <tr>
            <th>Termin vom:</th>
            <td>
                <?php echo ($training->appointment_from) ? date("d.m.Y - H:i",strtotime($training->appointment_from)) : 'n/a' ; ?></td>
        </tr>
        <tr>
            <th>Termin bis:</th>
            <td>
                <?php echo ($training->appointment_to) ? date("d.m.Y - H:i",strtotime($training->appointment_to)) : 'n/a' ; ?></td>
        </tr>
        <?php if(isset($survey) && $survey->survey_from) echo '
			<tr>
	            <th>Start der Umfrage:</th>
	            <td>'.date("d.m.Y - H:i",strtotime($survey->survey_from)).'</td>
        	</tr>';
		?>
       <?php if(isset($survey) && $survey->survey_to)
				echo '
		<tr>
            <th>Deadline:</th>
            <td>'.date("d.m.Y - H:i",strtotime($survey->survey_to)).'</td></tr>'; 
       ?>        
       <?php if($training->booked_at) echo '
		<tr>
            <th>Gebucht am:</th>
            <td>date("d.m.Y - H:i",strtotime($training->booked_at))</td>
		</tr>'; 
       ?>
        
    </table>

    <?php else: ?>
    Noch kein Termin festgelegt!
    <?php endif; ?>
</fieldset>
<?php endif; ?>